Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
How do I make "msg.content" constantly get new strings added to it instead of replaced?
 var collector = new MessageCollector(message.channel, filter, {
    max: 10,
    time: 60000,
})

        collector.on("collect", (msg) => {
            console.log(msg.content)
            
        openai.Completion.create({
            
            engine: "davinci",
            prompt: msg.content,
            temperature: 0.9,
            max_tokens: 150,
            top_p: 1,
            frequency_penalty: 0.35,
            presence_penalty: 0.6, 
            stop: ["\n", " Human:", " AI:"]  
        
        }).then((response) => {
            
            message.channel.send(response.choices[0].text)
        })

    })
}

So I was trying to implement the AI "GPT-3" into a discord bot to see how it would work, but GPT-3 needs to know the prompt (basically context of a conversation) all the time. With the way I have it set up, it constantly replaces the variable (msg.content) with new strings once they are grabbed by "MessageCollector". I need to make it so that whenever a message is detected, it adds that string to the variable and constantly doing that until, lets say a timer goes off.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!